package com.ask.forMe.service.impl;

import com.ask.forMe.model.entity.Item;
import com.ask.forMe.mapper.ItemMapper;
import com.ask.forMe.service.ItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ItemServiceImpl extends ServiceImpl<ItemMapper, Item> implements ItemService {
    @Autowired
    private ItemMapper itemMapper;

    /**
     * 根据销量获取TopN的商品
     * @param topN
     * @return
     */
    @Override
    public List<Long> getHotBySales(int topN) {
        List<Long> hotItemIds = itemMapper.getHotBySales(topN);
        return hotItemIds;
    }


}
